package com.translate.web.service;

import com.basic.service.contract.IBaseService;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.translate.entity.OrderDiscountInformation;
import com.translate.web.param.contract.IOrderDiscountInformationAddParam;

public interface IOrderDiscountInformationService extends IBaseService<OrderDiscountInformation> {

	/**
	 * 订单信息
	 * @param <S>
	 * @param list 订单折扣参数 
	 * @param orderId 订单编号
	 * @param products 商品 id 和 price
	 * @param createId 创建者
	 * @param belongPersonId 跟进人
	 * @return
	 */
	<S extends IOrderDiscountInformationAddParam> int batchInsert(List<S> list, int orderId,
			Map<Integer, BigDecimal> products, int createId, int belongPersonId);

	<S extends IOrderDiscountInformationAddParam> BigDecimal getTotalPrice(List<S> list, 
			Map<Integer, BigDecimal> products);

	/**
	 * 获取订单折扣信息列表
	 * 
	 * @param id
	 * @return
	 */
	List<OrderDiscountInformation> getOrderDiscount(int id, int belongingPersonId);
	
	/**
	 * 更新订单
	 * @param <S>
	 * @param recive
	 * @param products
	 * @param assocId
	 * @param userId
	 * @return
	 */
	public <S> int updateOrderInfo(List<S> recive, Map<Integer, BigDecimal> products,  int assocId, int userId, int belongPersonId);
	
}
